function id(id) {
	return document.getElementById(id);
}

function name(name) {
	return document.getElementsByName(name);
}

function checkRegister() {	

	var username = id("username");
	if (username.value == "") {
		alert("用户名不能为空！");
		username.focus();
		return false;
	}
	
	var passwd = id("passwd");
	if (passwd.value == "") {
		alert("密码不能为空！");
		passwd.focus();
		return false;
	}
	
	if (passwd.value.length > 6) {
		alert("密码不能超过6位！")
		passwd.focus();
		return false;
	}
	
	var passwdconfirm = id("passwdconfirm");
	if (passwd.value != passwdconfirm.value) {
		alert("两次密码输入不一致！");
		passwdconfirm.focus();
		return false;
	}
	
	var birth = id("birth");
	if (birth.value == "") {
		alert("请选择生日！");
		birth.focus();
		return false;
	}
	
	var phone = id("phone");
	if (phone.value == "") {
		alert("电话不能为空！");
		phone.focus();
		return false;
	}
	
	var address = id("address");
	if (phone.value.isNaN) {
		alert("电话号格式有误！");
		phone.focus();
		return false;
	}
	
	var username = id("username");
	if (phone.value.length != 11) {
		alert("电话号格式有误！");
		phone.focus();
		return false;
	}
	return true;
}